package com.jintian.smart.kernel.common.util;

public class MethodUtil {
    public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];

    public static Object invokeMethod(final Object object, final boolean forceAccess, final String methodName, Object... args) {
        args = ArrayUtil.nullToEmpty(args);
        final Class<?>[] parameterTypes = ClassUtil.toClass(args);
        return invokeMethod(object, forceAccess, methodName, args, parameterTypes);
    }

    public static Object invokeMethod(final Object object, final String methodName, Object... args) {
        args = ArrayUtil.nullToEmpty(args);
        final Class<?>[] parameterTypes = ClassUtil.toClass(args);
        return invokeMethod(object, methodName, args, parameterTypes);
    }

}
